<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>操作元素文本内容</title>
</head>
<body>
    <div id="box">
        hello world
        <div>
            陈志攀
        </div>
    </div>
    <script>
        // console.log(box.innerHTML)
        // box.innerHTML = "<h1>hello world</h1>"

        console.log(box.innerText)
        box.innerText = "<h1>hello world</h1>"
    </script>
</body>
</html>